from django.db import models


# Create your models here.
# 多对多
# 用户： 电影 = N : M

# 电影
class Movie(models.Model):
    name = models.CharField(max_length=50)
    duration = models.IntegerField(default=90)


# 用户
class User(models.Model):
    name = models.CharField(max_length=30)
    age = models.IntegerField(default=18)

    # 多对多关系
    movies = models.ManyToManyField(Movie)

